## DRUM on Windows with WSL2 {: #drum-on-windows-with-wsl2 }

DRUM can be run on Windows 10 or 11 with WSL2 (Windows Subsystem for Linux), a native extension that is supported by the latest versions of Windows and allows you to easily install and run Linux OS on a Windows machine. With WSL, you can develop custom tasks and custom models locally in an IDE on Windows, and then immediately test and run them on the same machine using DRUM via the Linux command line.

!!! tip
	You can use this [YouTube video](https://www.youtube.com/watch?v=wWFI2Gxtq-8){ target=_blank } for instructions on installing WSL into Windows 11 and updating Ubuntu. 

The following phases are required to complete the Windows DRUM installation:

1. [Enable WSL](#enable-linux-wsl)
2. [Install `pyenv`](#install-pyenv)
3. [Install DRUM](#install-drum-on-windows)
4. [Install Docker Desktop](#install-docker-desktop)

### Enable Linux (WSL) {: #enable-linux-wsl }

1. From **Control Panel > Turn Windows features on or off**, check the option **Windows Subsystem for Linux**. After making changes, you will be prompted to restart.

	![](images/cml-drum-1.png)

2. Open [Microsoft store](https://aka.ms/wslstore){ target=_blank } and click to get Ubuntu.

	![](images/cml-drum-2.png)

3. Install Ubuntu and launch it from the start prompt. Provide a Unix username and password to complete installation. You can use any credentials but be sure to record them as they will be required in the future.

	![](images/cml-drum-5.png)

You can access Ubuntu at any time from the Windows start menu. Access files on the C drive under **/mnt/c/**.

![](images/cml-drum-6.png)


### Install pyenv {: #install-pyenv }

Because Ubuntu in WSL comes without Python or virtual environments installed, you must install `pyenv`, a Python version management program used on macOS and Linux. (Learn about managing multiple Python environments [here](https://codeburst.io/how-to-install-and-manage-multiple-python-versions-in-wsl2-1131c4e50a58){ target=_blank }.)

In the Ubuntu terminal, run the following _commands_ (you can ignore comments) row by row:

``` sh
cd $HOME
sudo apt update --yes
sudo apt upgrade --yes

sudo apt-get install --yes git
git clone https://github.com/pyenv/pyenv.git ~/.pyenv

#add pyenv to bashrc
echo '# Pyenv environment variables' >> ~/.bashrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo '# Pyenv initialization' >> ~/.bashrc
echo 'if command -v pyenv 1>/dev/null 2>&1; then' >> ~/.bashrc
echo '  eval "$(pyenv init -)"' >> ~/.bashrc
echo 'fi' >> ~/.bashrc

#restart shell
exec $SHELL

#install pyenv dependencies (copy as a single line)
sudo apt-get install --yes libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libgdbm-dev lzma lzma-dev tcl-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev wget curl make build-essential python-openssl

#install python 3.7 (it can take awhile)
pyenv install 3.7.10
```
### Install DRUM on Windows {: #install-drum-on-windows }

To install DRUM, first you setup a Python environment where DRUM will run, and then install DRUM in that environment.

1. Create and activate a `pyenv` environment:

	``` sh
	cd $HOME
	pyenv local 3.7.10
	.pyenv/shims/python3.7 -m venv DR-custom-tasks-pyenv
	source DR-custom-tasks-pyenv/bin/activate
	```

2. Install DRUM and its dependencies into that environment:

	``` sh
	pip install datarobot-drum
	exec $SHELL
	```

3. Download container environments, where DRUM will run, from Github.

	`git clone https://github.com/datarobot/datarobot-user-models`

### Install Docker Desktop {: #install-docker-desktop }

While you can run DRUM directly in the `pyenv` environment, it is preferable to run it in a Docker container. This recommended procedure ensures that your tasks run in the same environment both locally and inside DataRobot, as well as simplifies installation.

1. Download and install [Docker Desktop](https://www.docker.com/products/docker-desktop){ target=_blank }, following the default installation steps.

2. Enable Ubuntu version WSL2 by opening Windows PowerShell and running:

	``` sh
	wsl.exe --set-version Ubuntu 2
	wsl --set-default-version 2
	```

	![](images/cml-drum-3.png)

	!!! note
	    You may need to download and install an [update](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi){ target=_blank }. Follow the instructions in the PowerShell until you see the **Conversion complete** message.

3. Enable access to Docker Desktop from Ubuntu:

	1. From the Window's task bar, open Docker Dashboard, then access **Settings** (the gear icon).
	2. Under **Resources > WSL integration > Enable integration with additional distros**, toggle on Ubuntu.
	3. Apply changes and restart.

	![](images/cml-drum-4.png)